<!--
 * @Descripttion: 库存查询列表
 * @version:
 * @Author: cxguo
 * @Date: 2019-08-02 15:03:05
 * @LastEditors: cxguo
 * @LastEditTime: 2020-08-19 17:12:53
 -->
<template>
  <div class="app-container">
    <Tab
      v-model="tabIndex"
      :texts="['日常收入','日常支出']"
      :is-show-date="false"
    />
    <component :is="currentTab" />
  </div>
</template>
<script>
import Affix from '@/components/Affix'
import Tab from '@/views/components/Tab'
import ListIn from './list-in'
import ListOut from './list-out'

export default {
  name: 'DailyincomeList',
  filters: {
  },
  // eslint-disable-next-line vue/no-unused-components
  components: { Tab, Affix, ListIn, ListOut },
  props: {
  },
  data() {
    return { tabIndex: 0 }
  },
  computed: {
    'currentTab': function() {
      const tabIndex = this.tabIndex
      if (tabIndex === 0) return 'ListIn'
      return 'ListOut'
    }
  },
  watch: {
    currentTab: {
      handler(val) {
        if (val === 'ListIn') this.tabIndex = 0
        if (val === 'ListOut') this.tabIndex = 1
      },
      immediate: true
    }
  },
  created() {
  },
  methods: {
  }
}
</script>
